import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}
const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/LoGin.vue')
  },
  {
    path: '/',
    component: () => import('@/views/LayOut.vue'),
    redirect: 'index',
    children: [
      {
        path: 'index',
        component: () => import('@/views/InDex.vue')
      },
      {
        path: 'manage',
        component: () => import('@/views/second/MaNage.vue')

      },
      {
        path: 'detail',
        component: () => import('@/views/second/DeTail.vue')
      }, {
        path: 'area',
        component: () => import('@/views/second/KuArea.vue')
      },
      {
        path: 'storemanage',
        component: () => import('@/views/second/StoreManage.vue')
      }, {
        path: 'kuweimanage',
        component: () => import('@/views/KuWeimanage')
      },
      {
        path: 'kuweilocation',
        component: () => import('@/views/second/KuWeilocation.vue')
      },
      {
        path:'kuweishitu',
        component:()=>import('@/views/KuWeishitu.vue')
      }, 
      {
        path: 'huopinmanage',
        component: () => import('@/views/HuoPin.vue')
      },
      {
        path:'addhuopin',
        component:()=>import ('@/views/second/AddHuopin.vue')
      },{
        path:'huopintype',
        component:()=>import('@/views/HuoPintype.vue')
      },
     
    ]
  }

]

const router = new VueRouter({
  routes
})

export default router
